import React from 'react'

const imageNormal = require('@/assets/images/dark-icon-image/wenjianjia-normal.png')
const imageOpen = require('@/assets/images/dark-icon-image/wenjianjia-open.png')

// const defaultIconFun = (theProps, selectedKeys = [], themeValue) => {
//   let i_classname = 'iconfont-colour2 '
//   let after = ''
//   if (selectedKeys && selectedKeys.includes(theProps.data.key)) {
//     i_classname += (theProps.expanded ? `icon-wenjianjia-dakaihover${after}` : `icon-wenjianjia-morenhover${after}`)
//   } else {
//     if (themeValue === 'dark') {
//       i_classname = 'iconfont-colour3 '
//       after = '_dark'
//     }
//     i_classname += (theProps.expanded ? `icon-wenjianjia-dakai${after}` : `icon-wenjianjia-moren${after}`)
//   }
//   return <i className={`${i_classname}`} style={{ fontSize: 'initial' }} />
// }
// export default defaultIconFun

const defaultIconFun = (theProps, selectedKeys, themeValue) => {
  let i_classname = 'iconfont-colour2 '
  if (themeValue === 'dark') {
    if (selectedKeys && selectedKeys.includes(theProps.data.key)) {
      i_classname += theProps.expanded ? 'icon-wenjianjia-dakaihover' : ' icon-wenjianjia-morenhover'
    } else {
      return theProps.expanded ? <i className="icon-dark-images"> <img src={imageOpen} alt="" /> </i>
        : <i className="icon-dark-images"> <img src={imageNormal} alt="" /></i>
    }
  } else if (selectedKeys && selectedKeys.includes(theProps.data.key)) {
    i_classname += theProps.expanded ? 'icon-wenjianjia-dakaihover' : 'icon-wenjianjia-morenhover'
  } else {
    i_classname += theProps.expanded ? 'icon-wenjianjia-dakai' : 'icon-wenjianjia-moren'
  }
  return <i className={`${i_classname}`} />
}
export default defaultIconFun
